package com.lingz.manager.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebAppConfig implements WebMvcConfigurer {
    /**
     * 图片保存路径，自动从yml文件中获取数据
     * D:/images/
     */

    @Value("${media.dir}")
    private String mediaDirPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("EnjoyGIS/images/**").addResourceLocations("file:"+ mediaDirPath + fileSavePath);
        registry.addResourceHandler("/wuxue/images/**").addResourceLocations("file:"+mediaDirPath + "images/");
//
    }
}
